<!-- BEGIN PAGE CONTAINER-->
<div class="container-fluid">
    <!-- BEGIN PAGE HEADER-->
    <div class="row-fluid">
        <div class="span12">
            <!-- BEGIN PAGE TITLE & BREADCRUMB-->
            <h3 class="page-title">
                Quản lý khách hàng
            </h3>
            <ul class="breadcrumb">
                <li>
                    <i class="icon-home"></i>
                    <a href="index.html">Trang chủ</a>
                    <i class="icon-angle-right"></i>
                </li>
                <li>
                    <a href="#">Khách hàng</a>
                    <i class="icon-angle-right"></i>
                </li>
                <li><a href="#">Thêm mới khách hàng</a></li>
            </ul>
            <!-- END PAGE TITLE & BREADCRUMB-->
        </div>
    </div>
    <!-- END PAGE HEADER-->
    <!-- BEGIN PAGE CONTENT-->
    <div class="row-fluid">
        <div class="span12">
            <!-- BEGIN EXAMPLE TABLE PORTLET-->
            <div class="portlet box light-grey">
                <div class="portlet-title">
                    <h4><i class="icon-plus-sign"></i>Thêm mới khách hàng</h4>
                    <div class="tools">
                        <a href="javascript:;" class="collapse"></a>
                    </div>
                </div>
                <div class="portlet-body form">
                    <?php
                        $form = $this->beginWidget('CActiveForm', array(
                            'id' => 'horizontal-form',
                            'action'=> '/admin/customer/create',
                            'enableAjaxValidation' => false,
                        ));
                    ?>
                    <!-- BEGIN FORM-->
                        <div class="row-fluid">
                            <div class="span6 ">
                                <div class="control-group <?php if ($form->error($model,'firstname') != "") echo "error"; ?>">
                                    <label class="control-label" for="firstName">Tên</label>
                                    <div class="controls">
                                        <?php echo $form->textField($model, 'firstname', array('size' => 45, 'maxlength' => 45, 'class'=>'m-wrap span12')); ?>
                                        <?php echo $form->error($model, 'firstname', array('class'=>'help-block')); ?>
                                    </div>
                                </div>
                            </div>
                            <!--/span-->
                            <div class="span6 ">
                                <div class="control-group <?php if ($form->error($model,'lastname') != "") echo "error"; ?>">
                                    <label class="control-label" for="lastName">Họ</label>
                                    <div class="controls">
                                        <?php echo $form->textField($model, 'lastname', array('size' => 45, 'maxlength' => 45, 'class'=>'m-wrap span12')); ?>
                                        <?php echo $form->error($model, 'lastname', array('class'=>'help-block')); ?>
                                    </div>
                                </div>
                            </div>
                            <!--/span-->
                        </div>
                        <div class="row-fluid">
                            <div class="span6 ">
                                <div class="control-group <?php if ($form->error($model,'password') != "") echo "error"; ?>">
                                    <label class="control-label" for="password">Password</label>
                                    <div class="controls">
                                        <?php echo $form->passwordField($model, 'password', array('size' => 45, 'maxlength' => 45, 'class'=>'m-wrap span12')); ?>
                                        <?php echo $form->error($model, 'password', array('class'=>'help-block')); ?>
                                    </div>
                                </div>
                            </div>
                            <!--/span-->
                            <div class="span6 ">
                                <div class="control-group <?php if ($form->error($model,'country_id') != "") echo "error"; ?>">
                                    <label class="control-label" for="country">Country</label>
                                    <div class="controls">
                                    	<select name="Users[country_id]" class="span12 chosen" data-placeholder="Choose a Country" tabindex="1">
                                            <option value="">Country</option>
                                            <?php foreach($countryList as $country) {?>
                                                <option <?php if($country->country_id == $customer->country_id) echo 'selected=selected';?> value="<?php echo $country->country_id;?>"><?php echo $country->name?></option>
                                            <?php }
                                            ?>
                                        </select>
                                	</div>
                                </div>
                            </div>
                            <!--/span-->
                        </div>
                        <!--/row-->
                        <div class="row-fluid">
                            <div class="span6 ">
                                <div class="control-group <?php if ($form->error($model,'street') != "") echo "error"; ?>">
                                    <label class="control-label" >Địa chỉ</label>
                                    <div class="controls">
                                        <?php echo $form->textField($model, 'street', array('size' => 45, 'maxlength' => 45, 'class'=>'m-wrap span12')); ?>
                                        <?php echo $form->error($model, 'street', array('class'=>'help-block')); ?>
                                    </div>
                                </div>
                            </div>
                            <!--/span-->
                            <div class="span6 ">
                                <div class="control-group <?php if ($form->error($model,'city') != "") echo "error"; ?>">
                                    <label class="control-label" >Thành phố</label>
                                    <div class="controls">
                                        <?php echo $form->textField($model, 'city', array('size' => 45, 'maxlength' => 45, 'class'=>'m-wrap span12')); ?>
                                        <?php echo $form->error($model,'city', array('class'=>'help-block')); ?>
                                    </div>
                                </div>
                            </div>
                            <!--/span-->
                        </div>
                        <!--/row-->
                        <div class="row-fluid">
                            <div class="span6 ">
                                <div class="control-group">
                                    <label class="control-label" >Bang</label>
                                    <div class="controls">
                                        <?php echo $form->textField($model, 'state', array('size' => 45, 'maxlength' => 45, 'class'=>'m-wrap span12')); ?>
                                        <?php echo $form->error($model,'state', array('class'=>'help-block')); ?>
                                    </div>
                                </div>
                            </div>
                            <!--/span-->
                            <div class="span6 ">
                                <div class="control-group <?php if ($form->error($model,'zipcode') != "") echo "error"; ?>">
                                    <label class="control-label" >Mã vùng</label>
                                    <div class="controls">
                                        <?php echo $form->textField($model, 'zipcode', array('size' => 45, 'maxlength' => 45, 'class'=>'m-wrap span12')); ?>
                                        <?php echo $form->error($model, 'zipcode', array('class'=>'help-block')); ?>
                                    </div>
                                </div>
                            </div>
                            <!--/span-->
                        </div>
                        <!--/row-->

                        <div class="row-fluid">
                            <div class="span6 ">
                                <div class="control-group <?php if ($form->error($model,'email') != "") echo "error"; ?>">
                                    <label class="control-label" for="firstName">Email</label>
                                    <div class="controls">
                                        <?php echo $form->textField($model, 'email', array('size' => 45, 'maxlength' => 45, 'class'=>'m-wrap span12')); ?>
                                        <?php echo $form->error($model, 'email', array('class'=>'help-block')); ?>
                                    </div>
                                </div>
                            </div>
                            <!--/span-->
                            <div class="span6 ">
                                <div class="control-group <?php if ($form->error($model,'phone') != "") echo "error"; ?>">
                                    <label class="control-label" for="lastName">Điện thoại</label>
                                    <div class="controls">
                                        <?php echo $form->textField($model, 'phone', array('size' => 45, 'maxlength' => 45, 'class'=>'m-wrap span12')); ?>
                                        <?php echo $form->error($model, 'phone', array('class'=>'help-block')); ?>
                                    </div>
                                </div>
                            </div>
                            <!--/span-->
                        </div>
                        <!--/row-->

                        <div class="form-actions">
                            <button type="submit" class="btn blue"><i class="icon-ok"></i> Lưu</button>
                            <button type="button" class="btn" onclick="window.location='/admin/products/admin'">Hủy</button>
                        </div>
                    <?php $this->endWidget(); ?>
                    <!-- END FORM-->
                </div>
            </div>
            <!-- END EXAMPLE TABLE PORTLET-->
        </div>
    </div>

    <!-- END PAGE CONTENT-->
</div>
<!-- END PAGE CONTAINER-->